home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / qmac215.zip / SCRATCHS.QM < prev   
Text File  |  1990-06-27  |  4KB  |  76 lines

  1. *
  2. * SCRATCHS.QM   --  A macro to auto-initialize a number of scratch buffers
  3. *                   on startup of QEdit 2.1, QEdit for OS/2 1.5, or QEdit TSR.
  4. *
  5. * Lets the user have a set of "standard" buffers, that contain the same
  6. * text every time, that are initialized upon entering QEdit with an
  7. * autoexecute macro.
  8. *
  9. * Modified to take advantage of JUMP commands---now handles an unlimited
  10. * number of Scratch Buffers.  (Limited only by RAM).
  11. *
  12. * INSTRUCTIONS:   See notes below on how to edit the macro to customize it
  13. *                 for the layout of your hard disk.
  14. *
  15. *                 Then, run QMAC to convert this to a binary macro:
  16. *
  17. *                      QMAC SCRATCHS.MAC SCRATCHS.QM B N
  18. *
  19. *                 You must use QMAC version 2.1 or higher to process this macro
  20. *
  21. *                 Then, use QEdit's /E command line switch to execute this
  22. *                 macro when you start up QEdit:
  23. *
  24. *                      Q /Escratchs.mac myfile.txt
  25. *
  26. * NOTES:  (1) Edit where it says 'SCRATCHS.LST' to be the full path
  27. *             specification of your scratch buffer file.  That will insure
  28. *             that this auto-execute macro will always be able to
  29. *             find it, no matter what directory you are in.
  30. *         (2) The format of the scratch buffer file looks like this:
  31. *              ┌──────────────────────┐
  32. *              │1                     │<---- Scratch name on line by itself
  33. *              │Text of scratch1■     │<---- Scratch text, followed by ASCII 254
  34. *              │2                     │<---- Second scratch name
  35. *              │This is the text of   │<---- Second scratch text
  36. *              │scratch number 2.     │
  37. *              │                      │      Type the delimiter character
  38. *              │Note that it can      │      by pressing the ALT key, pressing
  39. *              │contain any text      │      2, 5 then 4 on the numeric keypad
  40. *              │except for an ASCII   │      with the ALT key held down,
  41. *              │254.  That is used    │      then releasing the ALT key.
  42. *              │to delimit the end    │
  43. *              │of the scratch buffer │
  44. *              │■                     │<---- NOTE delimiter on line by itself
  45. *              │3                     │      so scratch above will include line
  46. *              │Scratch 3■            │      break
  47. *              └──────────────────────┘
  48. *         (3) All scratch buffers are marked as CHARACTER marks.
  49. *
  50. *
  51. @f12   MacroBegin
  52.        EditFile 'SCRATCHS.LST'              * Load the scratchs file into QEdit
  53.        Return
  54.        BegFile BegLine                      * Go to the top of it
  55.        MarkLine Cut                         * Get the scratch NAME, Cut to SCRAP
  56.        MarkBlockBegin                       * Mark beginning of scratch TEXT
  57.        Find #254 Return " " Return          * Find the end of the scratch TEXT
  58.        MarkBlockEnd                         * Mark the end.
  59.        StoreScrBuff Paste Return            * STORE the block to name in SCRAP
  60.        DropAnchor PrevPosition              * And delete this text to get it
  61.        DeleteBlock DelLine                  *     out of our way for now.
  62.        CursorDown CursorUp                  * Only one line in file?
  63.        JFalse NO_MORE:                      * If so, get out of here.
  64.  
  65.     SECOND_PASS:                            * Same thing, using RepeatFind
  66.        BegLine MarkLine Cut MarkBlockBegin RepeatFind MarkBlockEnd
  67.        StoreScrBuff Paste Return
  68.        DropAnchor PrevPosition DeleteBlock DelLine
  69.        CursorDown CursorUp                  * Are we at bottom of file?
  70.        JTrue SECOND_PASS                    * If not, repeat.
  71.  
  72.     NO_MORE:
  73.        Quit                                 * Discard edited SCRATCH file
  74.                                             * (Don't save the deletions)
  75.  
  76.